<?php
$conn=mysql_connect("localhost","root","root");
if(!$conn){
    die ("数据库连接失败！");
}
mysql_select_db("test",$conn);
mysql_query("set names 'utf8'");